import request from "@/common/js/request.js";
import { channelRequestHeadFun } from "@/common/js/util";

const SERVER_URL = "/api/agent/agent/agent-web";
const tenantId = 'gysk'

export default {
  // 客经用户个人信息查询
  postQueryInfoData(data) {
    let { headData, aesData } = channelRequestHeadFun(true, data);
    return request({
      url: `${SERVER_URL}/v1/api/user/user/mini/query/info`,
      method: "post",
      data: { channelRequestHead: headData, requestBody: { data: aesData } },
    });
  },
  // 客经用户下级信息查询
  postQuerySubordinateData(data) {
    let { headData, aesData } = channelRequestHeadFun(true, data);
    return request({
      url: `${SERVER_URL}/v1/api/user/user/mini/querySubordinate`,
      method: "post",
      data: { channelRequestHead: headData, requestBody: { data: aesData } },
    });
  },
  // 修改个人信息
  postUpdateData(data) {
    let { headData, aesData } = channelRequestHeadFun(true, {...data, tenantId});
    return request({
      url: `${SERVER_URL}/v1/api/user/user/mini/update`,
      method: "post",
      data: { channelRequestHead: headData, requestBody: { data: aesData } },
    });
  }
};
